package fem2.gui.actions;

import inf.vtk.AutomaticHardCopy;
import inf.vtk.VTKCanvas;
import inf.vtk.pm.PipelineCollection;
import inf.vtk.uiswing.RenderHardCopyDialog;

import java.awt.Frame;
import java.awt.event.ActionEvent;

public class ShowHardcopyDialogAction extends ActionBase {

	private static final long serialVersionUID = 1L;

	private AutomaticHardCopy renderHardCopy_;

	public ShowHardcopyDialogAction(PipelineCollection pc) {
		super("Hard Copy...", pc);
	}

	public void actionPerformed(ActionEvent al) {
		new RenderHardCopyDialog(getRenderHardCopy(), Frame.getFrames()[0],
				"Hard Copy", true).setVisible(true);
	}

	AutomaticHardCopy getRenderHardCopy() {
		if (renderHardCopy_ == null) {
			renderHardCopy_ = new AutomaticHardCopy(VTKCanvas.getActiveCanvas());
		}
		return renderHardCopy_;
	}
}
